<script setup>
import { ref, onMounted } from 'vue'
import { artGetChannelServices } from '@/api/article.js'

defineProps({
  modelValue: {
    required: true,
    type: [Number, String]
  },
  width: { type: String }
})
const emit = defineEmits(['update:modelValue'])

const cateList = ref([])
onMounted(async () => {
  let response = await artGetChannelServices()
  cateList.value = response.data.data
})
</script>

<template>
  <el-select
    :style="{ width }"
    :modelValue="modelValue"
    @update:modelValue="emit('update:modelValue', $event)"
  >
    <el-option v-for="cate in cateList" :label="cate.cate_name" :value="cate.id" :key="cate.id" />
  </el-select>
</template>

<style scoped></style>
